<template>
  <div>
    <!--  -->
    <el-container>
      <el-header height="130px">
        <home-header></home-header>
      </el-header>
      <el-container>
        <el-aside width="300px">
          <home-aside></home-aside>
        </el-aside>
        <el-main>
          <div v-if="show">
            <home-current></home-current>
          </div>
          <router-view v-else></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import HomeHeader from "@/components/home/HomeHeader";
import HomeAside from "@/components/home/HomeAside";
import HomeCurrent from "@/components/home/HomeCurrent";
export default {
  mounted() {
    this.showHome(this.$route);
  },
  data() {
    return {
      show: false,
    };
  },
  methods: {
    showHome(value) {
      if (value.path === "/home") {
        this.show = true;
      } else {
        this.show = false;
      }
    },
  },
  components: {
    HomeHeader,
    HomeAside,
    HomeCurrent,
  },

  watch: {
    $route(value) {
      // console.log(value);
      this.showHome(value);
    },
  },
};
</script>

<style lang="scss" scoped>
div {
  .el-container {
    background-color: #b3c0d1;
    // .el-header{}
    .el-container {
      .el-aside {
        background-color: #d3dce6;
      }
      .el-main {
        background-color: #e9eef3;
      }
    }
  }
}
</style>